package com.nny.alarm;


import com.nny.alarm.audio.AudioEffect;
import com.nny.alarm.service.NNYService;
import com.uxwine.alarm.AlarmCore;

import android.app.Application;
import android.content.Context;

public class MainApplication extends Application
{
	static boolean mbInitAlarm = false;
	
	@Override
	public void onCreate() {
		super.onCreate();
		AudioEffect.getInstance(this).init();
		initAlarm(getApplicationContext());
		NNYService.start(this);
	}
	
	public synchronized static void initAlarm(Context ctx)
	{
		if(!mbInitAlarm)
		{
			AlarmCore.nextAlert(ctx.getApplicationContext());
			mbInitAlarm = true;
		}
	}
}
